package main.bufferIO;

import java.io.*;

public class BufferRW {
    public static void main(String[] args) {
        try{
            //bufferR("data//rr.txt");
            bufferW("data//rrOut.txt");
        }catch (IOException e){
            e.printStackTrace();
        }

    }

    public  static  void bufferR(String filePath) throws IOException {
        BufferedReader bIn = new BufferedReader(new FileReader(filePath));
        char[] ch = new char[10];
        int len = 0;
        while((len = bIn.read(ch))!=-1) {
            System.out.println(new String(ch, 0, len));
        }
        bIn.close();
    }
    public static void bufferW(String filePath) throws IOException{
        BufferedWriter bOut = new BufferedWriter(new FileWriter(filePath,true));
        String str = "哈哈哈哈哈哈哈哈哈哈哈 dddd";
        bOut.write(str);
        bOut.write(str);
        bOut.flush();
        bOut.close();
    }

}
